package net.togogo.controller;

import net.togogo.entity.TbOrder;
import net.togogo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer")
public class ConsumerController {

    @Autowired
    OrderService orderService;

    @PostMapping("/order")
    public String order(@RequestBody TbOrder order){
        return orderService.generate(order);
    }
}
